﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WikiTaskProject
{
    public partial class ButtonResize : Form
    {
        public ButtonResize()
        {
            InitializeComponent();
        }

        private int _wight;
        private int _height;

        private void Form_ResizeBegin(object sender, EventArgs e)
        {
            _wight = this.Size.Width;
            _height = this.Size.Height;
        }

        private void Form_Resize(object sender, EventArgs e)
        {
            button1.Width = button1.Width - (this.Width - _wight);
            button1.Height = button1.Height - (this.Height - _height);
        }

        private void Form_ResizeEnd(object sender, EventArgs e)
        {
            button1.Invalidate();
        }


   }
}
